<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script type="text/javascript">
        var obj = {
            name: "tom",
            age: 18,
            fun : function() {
                alert("姓名:" + this.name + ", 年龄:" + this.age);
            }
        };
        alert(obj.name);
        obj.fun();
    </script>
</head>
<body>
    
</body>
</html>